﻿--|--------------------------------------------------------------------------------
--| [GetGameByName] - Insert Procedure Script for Game
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[GetGameByName]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
  DROP PROCEDURE [dbo].[GetGameByName]
GO

CREATE PROCEDURE [dbo].[GetGameByName]
(
	@TeamID int,
	@Name nvarchar(50)
)
AS
	SET NOCOUNT ON

	SELECT
		[ID],
		[TeamID],
		[Name],
		[Description],
		[CreationDate]
	FROM 
	[Game] G
	WHERE
		G.[Name] = @Name
		AND G.TeamID = @TeamID
	
GO

  